home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / gofer221.zip / README < prev    next >
Text File  |  1991-11-20  |  5KB  |  110 lines

  1. This directory contains the source for the Gofer interpreter for use with
  2. SunOS 4.x machines (probably SunOS 3.5 too) and Turbo C 1.5 on the PC.
  3.  
  4. ---------------------
  5. For SunOs versions, edit prelude.h to get:
  6.  
  7. #define TURBOC   0      /* This version for IBM PC, using Turbo C 1.5      */
  8. #define UNIX     1      /* This version for Sun 3/Sun 4 running SunOS 4.x  */
  9.  
  10. and then compile using the Makefile supplied.  The script `gofer' in this
  11. directory can be edited to provide a convenient way of starting Gofer,
  12. particularly if you intend using Gofer on both Sun 3 and Sun 4 machines.
  13.  
  14. The version of parser.c supplied with the Gofer system is specifically
  15. intended to be used to build the PC version of Gofer.  When compiling
  16. Gofer on a UNIX based machine, it is usually best to delete this file,
  17. and rely on the version of yacc provided by your system to obtain an
  18. appropriate version of parser.c.
  19. ---------------------
  20. For PC version, change the lines above to:
  21.  
  22. #define TURBOC   1      /* This version for IBM PC, using Turbo C 1.5      */
  23. #define UNIX     0      /* This version for Sun 3/Sun 4 running SunOS 4.x  */
  24.  
  25. and compile from the Turbo C environment using the GOFER.PRJ file supplied,
  26. with MEDIUM model (64K data, upto 1MB code), and stack checking enabled.
  27.  
  28. Gofer can also be compiled using Turbo C++ (the version I tried was 1.01)
  29. although this resulted in a binary that was 33% bigger than that produced
  30. by Turbo C 1.5.  Perhaps this was caused by some unwanted compiler options
  31. (line numbers/debugging information?) but I did not have time to investigate.
  32.  
  33. Note that the PC version of Gofer does not currently support the use of
  34. floating point numbers.  The corresponding section of the standard prelude
  35. file `prelude' must be commented out before Gofer can be used on a PC.
  36.  
  37. The relevant sections of the prelude are now flagged by lines:
  38.  
  39.     {- PC version off -}
  40.     lines which must be excluded
  41.     {- PC version on -}
  42.  
  43. [There are two such sections, beginning in lines 196 and 681 respectively.]
  44. To prepare the prelude file to be used on PCs, edit these lines to get:
  45.  
  46.     {- PC version off
  47.     lines which must be excluded
  48.     PC version on -}
  49. ---------------------
  50. Gofer has not yet been tested on other platforms, although most of the Gofer
  51. code is fairly standard.  The code does however make certain assumptions about
  52. the system on which Gofer will be used.  These are summarised below as an aid
  53. to those interested in porting Gofer to other systems:
  54.  
  55. 1) For the benefit of Garbage collection from the C stack, all function
  56.    parameters and local variables are expected to have sizes which are
  57.    a multiple of sizeof(Int) (defined in prelude.h).  In other words,
  58.    you should check that:
  59.  
  60.              sizeof(FloatImpType) % sizeof(Int) == 0
  61.              sizeof(String)       % sizeof(Int) == 0
  62.              sizeof(Char)         % sizeof(Int) == 0
  63.              sizeof(Long)         % sizeof(Int) == 0
  64.              sizeof(Unsigned)     % sizeof(Int) == 0
  65.  
  66.    (These types are defined in prelude.h and storage.h)
  67.  
  68. 2) Floating point numbers can only be supported on systems in which
  69.                       sizeof(float)<=sizeof(Cell)
  70.    The symbol HASFLOATS should be #defined in prelude.h if this condition
  71.    is satisfied and floating point numbers are required, but should otherwise
  72.    be left undefined.
  73.  
  74. 3) The words local and far are used to access non-standard extensions in
  75.    Turbo C to allow the Gofer system to overcome some of the limitations of
  76.    the PC's segmented architecture.  These should be #defined to empty strings
  77.    on most other machines with a flat address space.
  78.  
  79. 4) prelude.h should include #defines for bitsPerWord, bitArraySize,
  80.    placeInSet and maskInSet which are used to access and manipulate
  81.    bit sets.  The standard version of prelude.h contains appropriate
  82.    versions of these macros for PCs (with 16 bit integers) and SunOs
  83.    machines (with 32 bit integers).
  84.  
  85. 5) The current version of the garbage collector assumes that the C stack
  86.    grows downwards (i.e. the stack pointer is decremented each time a value
  87.    is pushed onto the stack).  If you encounter a machine in which the stack
  88.    grows upwards, replace the line   "markWithoutMove(*ptr++);" in machdep.c
  89.                               with   "markWithoutMove(*ptr--);".
  90.  
  91. Almost all of the machine dependencies in the code for Gofer are contained
  92. in the header file "prelude.h", and the program file "machdep.c".  These
  93. files contain definitions for both the TURBOC and UNIX versions described
  94. above and should be a useful guide.
  95.  
  96. I regret that I do not have time to write more substantial notes for
  97. porting Gofer at the present time.  I will however be happy to offer
  98. advice and answer other questions if you want to contact me in person
  99. at the email address below.
  100. ---------------------
  101.  
  102. NOTE: if Gofer starts behaving unexpectedly, try recompiling
  103. without full compiler optimisation and see if the problem still occurs.
  104. If so, please get in touch with me, giving me as much information about
  105. the problem as possible, and I'll try and sort it out for you.  If you
  106. find a bug which you fix yourself, please send me details so that I can
  107. pass the fix onto to other users of Gofer.
  108.  
  109. mpj@prg.ox.ac.uk
  110.